From 0b7a96f8b7a184dadf29d3dbd6cef91d598e46ab Mon Sep 17 00:00:00 2001 From: robertl Date: Tue, 14 Oct 2003 13:20:00 +0000 Subject: [PATCH] Correctly terminate created string. From Mark Bradley. --- util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util.c b/util.c index 5219a6606..de96b5959 100644 --- a/util.c +++ b/util.c @@ -171,7 +171,7 @@ xstrndupt(const char *str, size_t sz) newstr = xmalloc(newlen + 1); memcpy(newstr, str, newlen); - newstr[newlen+1] = '\0'; + newstr[newlen] = '\0'; rtrim(newstr); return newstr; -- 2.30.2